<?php
	define(IMPORT,'../class.mamatblog/',true);
	require_once(IMPORT.'mysql.php');
	require_once(IMPORT.'comment.php');
	require_once(IMPORT.'page.php');	

	//comment
	$comm = new Comment();
	
	//page
	$pageMain = new Page();
	$pageDetail = $pageMain->getMainPage();
	for($i = 0; $i < count($pageDetail); $i++) {
?>

<h2 class="first"><a href="#" id="author" onclick="makeRequest('mainpagedetail.php?p=<?php echo $pageDetail[$i][0];?>','main','Tunggu yak lagi Loading main page..!')"><?php echo $pageDetail[$i][2];?></a></h2>
			
<p class="postdata">

	Posted on <?php echo $pageDetail[$i][1];?> by <a href="#"><?php echo $pageMain->getPageAuthor($pageDetail[$i][5]);?></a> || <a href="#" onclick="makeRequest('mainpagedetail.php?p=<?php echo $pageDetail[$i][0];?>','main','Tunggu yak lagi Loading main page..!')"><?php echo $comm->getCommentRows($pageDetail[$i][0]);?> Comments</a>

</p>


<p>
<?php echo $pageMain->parseStr(nl2br(str_replace('[/code]','</pre></div>',(str_replace('[code]','<div style="background-color:#000000;color:#FFFFFF;"><pre>',$pageDetail[$i][3])))),20) ;?>

</p>
<p><a href="#" onclick="makeRequest('mainpagedetail.php?p=<?php echo $pageDetail[$i][0];?>','main','Tunggu yak lagi Loading main page..!')">Detail...</a></p>
<?php
	}
?>